﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<brjostagjof.Models.Question>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Ósvaraðar spurningar
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <a href="/Home/SogS/" class="linksWhite">Til baka í S.og.S</a>

    <% foreach (var item in Model) 
       { %>
    <h2 class="title"><%: item.ArticleBase.InformationBase.headline %></h2>
    <p class="meta">Höfundur: <a href="../../MySite/ViewUserByID/<%:item.ArticleBase.User.ID  %>"><%: item.ArticleBase.User.name%></a>, <%: item.ArticleBase.InformationBase.date %>  &nbsp;&bull;&nbsp;
    <a href="/Home/GetQuestionsByCategoryID/<%: item.ArticleBase.ArticleCategory.ID %>" class="permalink"> <%: item.ArticleBase.ArticleCategory.name %></a>
    </p>
    <div class="entry">
    <div class="entry-bgtop">
    <div class="entry-bgbtm">
        <span class="ToBold">Spurning:</span>
        <p><%= item.ArticleBase.InformationBase.context %></p>
        <br />
        <% if (item.specialistID != null)
           { %>
        <span class="ToBold">Svar:</span>
        <p><%= item.ArticleBase.Question.answer%></p>
        <p class="meta"><a href="#"><%: item.SpecialistUser.User.name%></a> <%: item.SpecialistUser.SpecialistCategory.name%>:</p>
        <%} %>
    </div>
    </div>
    </div>
    <% if(Page.User.IsInRole("Specialists") || Page.User.IsInRole("Administrators"))
       { %>
    <p><a href="/Home/EditAnswer/<%: item.articleBaseID %>">Svara</a></p>
    <% } %>
    <% } %>

</asp:Content>
